Hi people,
I am quite new to JS-scripting and I have a question.
Finally I found a "good" slideshow which works in IE, Chrome, FF with prototype.
The only thing is that I would like the slideshow to stop when the mouse is over the slideshow and start again when the pointer leaves the pics.
Thanks alot in advance!
Already found something, but don't know how to implement it:
------
myTimer = setTimeout(.............)
onmouseover = clearTimeout(myTimer)
onmouseout = fadeInOut();
-------
script:
------- - var delay = 4000;
-
var start_frame = 0;
-
-
function init() {
-
var lis = $('slide-images').getElementsByTagName('li');
-
-
for( i=0; i < lis.length; i++){
-
if(i!=0){
-
lis[i].style.display = 'none';
-
}
-
}
-
end_frame = lis.length -1;
-
-
start_slideshow(start_frame, end_frame, delay, lis);
-
}
-
-
function start_slideshow(start_frame, end_frame, delay, lis) {
-
setTimeout(fadeInOut(start_frame,start_frame,end_frame, delay, lis), delay);
-
}
-
-
function fadeInOut(frame, start_frame, end_frame, delay, lis) {
-
return (function() {
-
lis = $('slide-images').getElementsByTagName('li');
-
Effect.Fade(lis[frame]);
-
if (frame == end_frame) { frame = start_frame; } else { frame++; }
-
lisAppear = lis[frame];
-
setTimeout("Effect.Appear(lisAppear);", 0);
-
setTimeout(fadeInOut(frame, start_frame, end_frame, delay), delay + 1850);
-
})
-
}
-
-
Event.observe(window, 'load', init, false);
-------
HTML:
------- - <head>
-
<script type="text/javascript" src="/libraries/prototype/prototype.js"></script>
-
<script type="text/javascript" src="/libraries/simple-slide-show.js"></script>
-
</head>
-
-
...
-
-
<div id="slide-show">
-
<ul id="slide-images">
-
-
<li><a href="/">
-
<img src="/template/images/new2/slider/slider1.png" alt="Target Link 1" />
-
</a></li>
-
-
<li><a href="/">
-
<img src="/template/images/new2/slider/slider2.png" alt="Target Link 2" />
-
</a></li>
-
-
<li><a href="/">
-
<img src="/template/images/new2/slider/slider3.png" alt="Target Link 3" />
-
</a></li>
-
-
</ul>
-
</div>
1 7448 Dormilich 8,658
Recognized Expert Moderator Expert
I’m not familiar with prototype, though I noticed - for( i=0; i < lis.length; i++){
-
if(i!=0){
-
lis[i].style.display = 'none';
-
}
-
}
why not starting with 1 instead explicitly checking for 0? - // the somewhat strange looking first term is used to speed up the loop
-
// because you calculate the length only once
-
for( var l, i=1, l=lis.length; i<l; i++){
-
lis[i].style.display = 'none';
-
}
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: engsol |
last post by:
I'm using Python to parse a bunch of s/w test files and make csv files for later report generation by MS ACCESS....(my boss
loves the quick turn-around compared to C). Each log file may contain one or more 'sessions', and each session may contain
one or more 'nodes'.
Each session in the log has an ASCII start and stop time, as does each...
|
by: marius |
last post by:
Hi!
I'm trying to make myself a simple webpage, enabling me to stop and
start certain services on the server.
I've been doing some reading, and have given permission for ASPNET
account to the services I'd like to control, but then I get stuck on a
"The RPC server is unavailable" error.
It does give me a hint:
"", but I haven't been able...
|
by: shai |
last post by:
I am working at .net 1.1, writing in c#.
I have windows service with a COM object.
Every unexpected time The COM object throw an error that make my service get
stuck (do not respond).
I can catch this error.
I want to restart my windows service every time the COM object throws an
error.
I use System.ServiceProcess.ServiceController to...
|
by: vikraman |
last post by:
Request the script for
Mouseover dispy of text at specific coordinats of an image/body and
Mouseout disply of original image/body
|
by: vikraman |
last post by:
I have a problem.
See the Mouseover event below
<head>
<script type="text/javascript">
function writeText(txt)
{
document.getElementById("x").innerHTML=txt
}
| |
by: anj |
last post by:
please provide me a syntax / command on how to create this tooltip (mouseover and mouseout) complete command. so i can apply it on my project.. please help me.. tnx
|
by: Wing |
last post by:
Hello fellow programmers. I am writing a desktop application that will allow our IT department to execute commands on remote computers. I had originally found a post that has a two part program that was working nicely
for half our computers. It seems that when the remote portion (which is a service) is running other programs will get hung up....
|
by: vikas1111 |
last post by:
Hi All..
I have created a slide show of some images using button,, now i want to stop the slide show when i mouseover the image or button, and restart the slide show when i move mouse out of the image.. Can anyone please give me an idea how to solve this ?? Its urgent.... I am pasting my code what i have done so far..
function...
|
by: delphi |
last post by:
Hi all,
I need help. I am new in javascript programming. And I had problem when I try to make a popup which showing another site. I had seen on few RL site.
And I need to stop the countdown timer until user click any links on the site in the popup and counting again, if can, then back to main window. How to do it?
Thanks before
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |